﻿<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example of Google Analytics analytics.js</title>
</head>
<body>
<script>
  /**
   * @fileoverview Google Analytics 埋点
   * 1. 在window中添加Google的命名空间ga
   * 2. 向ga中添加访问时刻时间戳、方法与参数
   * 3. 异步加载analytics.js
   */
  (function (i, s, o, g, r, a, m) {
    i['GoogleAnalyticsObject'] = r;
    i[r] = i[r] || function () {
      (i[r].q = i[r].q || []).push(arguments)
    }, 
    i[r].l = 1 * new Date();
    
    a = s.createElement(o),
    m = s.getElementsByTagName(o)[0];
    a.async = 1;
    a.src = g;
    m.parentNode.insertBefore(a, m)
  })(window, document, 'script', './www.google-analytics.com/analytics.js', 'ga');
  //})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-11578127-15', 'auto');
  ga('send', 'pageview');
</script>

</body>
</html>
